<template>
  <div>
    <!-- 经纪人管理 -->
    <el-table
      :data="tableData"
      border
      style="width: 100%"
    >
      <el-table-column
        prop="date"
        label="图片"
      >
        <template v-slot="{row}">
          <img :src="row.image" style="width:100px" alt="">
        </template>
      </el-table-column>
      <el-table-column
        prop="name"
        label="名称"
      />
      <el-table-column
        prop="email"
        label="邮箱"
      />
      <el-table-column
        prop="phone"
        label="电话"
      />
      <el-table-column
        v-if="address"
        prop="address"
        label="地址"
      />

      <slot name="broker" />
      <slot name="wchat" />
      <el-table-column
        prop="desc"
        label="介绍"
      />
      <el-table-column

        label="操作"
      >
        <template v-slot="{row}">
          <el-row type="flex" justify="center">
            <el-button type="primary" size="mini" @click="putagents(row)">编辑</el-button>
            <el-button type="success" size="mini" @click="delbtn(row)">删除</el-button>
          </el-row>
        </template>
      </el-table-column>
    </el-table>

  </div>
</template>
<script>
export default {
  props: {
    tableData: {
      type: Array,
      default: () => {}
    },
    address: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    putagents(row) {
      // 点击添加发送id
      //   经纪管理
      this.$emit('Addagents', row.id)
      //   客户管理
      this.$emit('Addclient', row.id)
    },
    // 点击删除
    delbtn(row) {
      // 客户管理，发送id
      this.$emit('delclient', row.id)
      // 经纪管理，发送id
      this.$emit('delagent', row.id)
    }
  }
}
</script>
<style>

</style>
